using Documenter, JuliaZH

const PAGES = [
    "主页" => "index.md",
    # hide("NEWS.md"),
    "手册" => [
        "manual/getting-started.md",
        "manual/variables.md",
        "manual/integers-and-floating-point-numbers.md",
        # "manual/mathematical-operations.md",
        "manual/complex-and-rational-numbers.md",
        "manual/strings.md",
        # "manual/functions.md",
        # "manual/control-flow.md",
        # "manual/variables-and-scoping.md",
        # "manual/types.md",
        # "manual/methods.md",
        # "manual/constructors.md",
        # "manual/conversion-and-promotion.md",
        # "manual/interfaces.md",
        # "manual/modules.md",
        # "manual/documentation.md",
        # "manual/metaprogramming.md",
        # "manual/arrays.md",
        # "manual/missing.md",
        # "manual/networking-and-streams.md",
        "manual/parallel-computing.md",
        # "manual/running-external-programs.md",
        # "manual/calling-c-and-fortran-code.md",
        # "manual/handling-operating-system-variation.md",
        # "manual/environment-variables.md",
        # "manual/embedding.md",
        # "manual/code-loading.md",
        # "manual/profile.md",
        # "manual/stacktraces.md",
        # "manual/performance-tips.md",
        # "manual/workflow-tips.md",
        "manual/style-guide.md",
        # "manual/faq.md",
        # "manual/noteworthy-differences.md",
        # "manual/unicode-input.md",
    ],
    "基础组件" => [
        "base/base.md",
        "base/collections.md",
        "base/math.md",
        "base/numbers.md",
        "base/strings.md",
        "base/arrays.md",
        "base/parallel.md",
        "base/multi-threading.md",
        "base/constants.md",
        "base/file.md",
        "base/io-network.md",
        "base/punctuation.md",
        "base/sort.md",
        "base/iterators.md",
        "base/c.md",
        "base/libc.md",
        "base/stacktraces.md",
        "base/simd-types.md",
    ],
    # "Standard Library" =>
    #     [stdlib.targetfile for stdlib in STDLIB_DOCS],
    # "Developer Documentation" => [
    #     "devdocs/reflection.md",
    #     "Documentation of Julia's Internals" => [
    #         "devdocs/init.md",
    #         "devdocs/ast.md",
    #         "devdocs/types.md",
    #         "devdocs/object.md",
    #         "devdocs/eval.md",
    #         "devdocs/callconv.md",
    #         "devdocs/compiler.md",
    #         "devdocs/functions.md",
    #         "devdocs/cartesian.md",
    #         "devdocs/meta.md",
    #         "devdocs/subarrays.md",
    #         "devdocs/sysimg.md",
    #         "devdocs/llvm.md",
    #         "devdocs/stdio.md",
    #         "devdocs/boundscheck.md",
    #         "devdocs/locks.md",
    #         "devdocs/offset-arrays.md",
    #         "devdocs/require.md",
    #         "devdocs/inference.md",
    #     ],
    #     "Developing/debugging Julia's C code" => [
    #         "devdocs/backtraces.md",
    #         "devdocs/debuggingtips.md",
    #         "devdocs/valgrind.md",
    #         "devdocs/sanitizers.md",
    #     ]
    # ],
    "中文文档开发" => [
        "juliacn/style-guide.md",
    ]
]

# make documents
makedocs(
    modules = [JuliaZH, Base, Core],
    clean = false,
    doctest = false,
    sitename = "Julia中文文档",
    checkdocs = :none, # we do not have translation of stdlib now
    linkcheck = false, # !("skiplinks" in ARGS),
    format    = "pdf" in ARGS ? :latex : :html,
    authors   = "Julia中文社区",
    analytics = "UA-89508993-1",
    pages = PAGES,
    html_prettyurls = !("local" in ARGS),
    html_canonical = "https://juliacn.github.io/JuliaZH.jl/latest/",
)

deploydocs(
    repo = "github.com/JuliaCN/JuliaZH.jl.git",
    target = "build",
    julia = "0.7",
    deps = nothing,
    make = nothing,
)
